package com.viknix.threadpool.manager.server.dependence.util;

import org.apache.commons.lang3.time.FastDateFormat;

import java.sql.Timestamp;
import java.util.Calendar;

/**
 * @Author: Dongqi
 * @Date: 2021/11/22 09:46
 * @Version 1.0
 * @Description: Time util.
 */
public class TimeUtils {
    
    public static Timestamp getCurrentTime() {
        return new Timestamp(System.currentTimeMillis());
    }
    
    public static String getCurrentTimeStr() {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(System.currentTimeMillis());
        FastDateFormat format = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss");
        return format.format(c.getTime());
    }
}
